<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
  <script src="../../js/vue.js"></script>  <!-- vue追加 -->
  <script src="../../js/axios.min.js"></script>		<!-- vue的AJAX追加 -->
 
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
 	
<style type="text/css">
	#empinfo{
		margin-top: 30px;
		margin-left: 80px;
		
	}
	
</style>
</head>
<body>
<br/>
<!-- 更改信息页 -->
<div style="margin-top:40px ;margin-left: 120px" >
	<font size="5">新增部门信息页</font></div><br/>
	
<div id="depInfo" style="">
	
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="depId"  type="text" name="title" placeholder="请输入部门编号" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="depName"  type="text" name="title" placeholder="请输入部门名称" autocomplete="off" class="layui-input">
	</div>
	
	<div class="layui-col-md7" style="margin-top: 10px">
		<input type="button"  @click="addDep" value="提交部门信息" style="margin-left: 100px" class="layui-btn layui-btn-radius"/><br/>
	</div>
</div>

<script >
	var empinfo=new Vue({
		el:"#depInfo",
		
		data:{
			depId:"",
			depName:"",
			list:[]
		},
		
		methods:{
			addDep:function(){
				axios.get(
					"http://localhost:8080/addDep",{
						params:{
							depId:this.depId,
							depName:this.depName
						}
					}
				).then(data=>{
					this.list=data.data.data
					alert(data.data.msg);
					
				})
			}
			
		}
		
		
	})
</script>

</body>
</html>